1
00:00:00,600 --> 00:00:01,880
Hello and welcome.

2
00:00:01,890 --> 00:00:13,260
In our previous lectures we went through how to create the functions and variables that will make the

3
00:00:13,260 --> 00:00:18,120
bricks vanish or disappear after they've been hit.

4
00:00:18,120 --> 00:00:29,190
We also create take function to track the State of the coalition to determine if a board or the break

5
00:00:29,490 --> 00:00:32,780
has been hit by the ball or not.

6
00:00:33,000 --> 00:00:45,360
In this lecture we will be activating all that by calling the coalition detection function so we can

7
00:00:45,500 --> 00:00:49,720
add quality to completion detection function that we create.

8
00:00:49,910 --> 00:00:55,690
We then add it inside the draw function so that it is called from there.

9
00:00:55,890 --> 00:01:03,600
An everything will be activated and then we can practice and we can see the ball actually hitting the

10
00:01:03,610 --> 00:01:06,030
brick and watching the bricks disappear.

11
00:01:06,030 --> 00:01:08,700
So let's go ahead and do that.

12
00:01:08,820 --> 00:01:16,860
So these are our functions here so let's look for where the other functions have been called from.

13
00:01:16,860 --> 00:01:22,500
So if you look at the function you draw this is where we we are calling the other functions from.

14
00:01:22,650 --> 00:01:30,600
So we want to add the quality detection function here just on the need the drol pad slate is called

15
00:01:30,930 --> 00:01:33,160
after the drop.

16
00:01:33,420 --> 00:01:38,120
So what we do will do collusion.

17
00:01:38,570 --> 00:01:44,660
So we're typing the name of the function which is collision right there.

18
00:01:44,670 --> 00:01:46,340
Coalition detection.

19
00:01:50,260 --> 00:01:52,370
And this is.

20
00:01:58,160 --> 00:02:00,760
And then the semicolon.

21
00:02:03,770 --> 00:02:08,000
All right so we as done have now added it so I save that.

22
00:02:08,090 --> 00:02:17,260
So if we load up the game we should see that in effect so win the ball and he hits the brick the bridge

23
00:02:17,260 --> 00:02:18,760
should disappear.

24
00:02:18,770 --> 00:02:20,570
So let's have a look.

25
00:02:21,090 --> 00:02:21,580
All right.

26
00:02:21,590 --> 00:02:30,920
This is the game now with the coalition detection activated so far used the panel and the ball should

27
00:02:30,920 --> 00:02:33,890
bounce off the pad and hit the bricks.

28
00:02:33,890 --> 00:02:36,140
The bricks should disappear.

29
00:02:36,140 --> 00:02:37,940
So let me have a go.

30
00:02:37,950 --> 00:02:40,460
Just have a look.

31
00:02:41,950 --> 00:02:44,640
Okay I lost that one.

32
00:02:45,540 --> 00:02:47,480
I lost again.

33
00:02:51,850 --> 00:02:52,870
Go home.

34
00:02:52,880 --> 00:02:56,040
Very good Sir Kenneth havlik again.

35
00:03:01,760 --> 00:03:04,180
He seeing some of the bricks have been

36
00:03:07,020 --> 00:03:14,860
here that's been set so we can see that the coalition detection is actually working because when the

37
00:03:14,860 --> 00:03:23,170
ball bounces off the paddle the orange rectangle Here's a look if it bounces off the rectangle and hits

38
00:03:23,470 --> 00:03:25,700
the brake it disappears.

39
00:03:25,730 --> 00:03:34,120
Obviously the ball should touch the bottom of the canvas then you lose the game so the goal is not to

40
00:03:34,120 --> 00:03:37,530
let the ball touch the bottom of the compass.

41
00:03:37,660 --> 00:03:47,170
And if you're able to use the ball to hit or the breaks and all the bricks disappear from the canvas

42
00:03:47,530 --> 00:03:49,600
then you have won the game.

43
00:03:49,930 --> 00:03:59,540
So in the nex section we are going to try and implement some scoring so that you could get this score.

44
00:03:59,550 --> 00:04:02,450
Point is time you hit it brick.

45
00:04:02,530 --> 00:04:04,690
Thank you so much for watching.

46
00:04:04,690 --> 00:04:05,670
Bye for now.